package jdbc.simple_factory.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionDataBase {
	
	public static void registerDriver(String DriverClass){
		try {
			Class.forName(DriverClass);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}
	
	public static Connection getConnection(String url,String username,String psd){
		Connection conn = null;
		try {
			conn = DriverManager.getConnection(url, username, psd);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return conn;
	}
	
}
